import request from '@/config/axios'

// 云呼坐席管理 VO
export interface CloudcallVO {
  id: number // ID
  adminId: number // 员工
  fromExten: string // 坐席工号
  extenType: string // 接听方式Local为“手机”
  status: number // 1正常0关闭
}

// 云呼坐席管理 API
export const CloudcallApi = {
  // 查询云呼坐席管理分页
  getCloudcallPage: async (params: any) => {
    return await request.get({ url: `/crm/cloudcall/page`, params })
  },

  // 查询云呼坐席管理详情
  getCloudcall: async (id: number) => {
    return await request.get({ url: `/crm/cloudcall/get?id=` + id })
  },

  // 新增云呼坐席管理
  createCloudcall: async (data: CloudcallVO) => {
    return await request.post({ url: `/crm/cloudcall/create`, data })
  },

  // 修改云呼坐席管理
  updateCloudcall: async (data: CloudcallVO) => {
    return await request.put({ url: `/crm/cloudcall/update`, data })
  },

  // 删除云呼坐席管理
  deleteCloudcall: async (id: number) => {
    return await request.delete({ url: `/crm/cloudcall/delete?id=` + id })
  },

  // 导出云呼坐席管理 Excel
  exportCloudcall: async (params) => {
    return await request.download({ url: `/crm/cloudcall/export-excel`, params })
  },

  getRedisSet: async () => {
    return await request.get({ url: `/crm/cloudcall/getRedisSet`})
  },

  saveRedisSet: async (data) => {
    return await request.post({ url: `/crm/cloudcall/saveRedisSet`, data })
  },

  call: async (params) => {
    return await request.get({ url: `/crm/cloudcall/call`, params })
  },
}